<template>
<div>
    <el-table :data="tableData" border style="width: 100%">
        <el-table-column type="selection" width="55">
        </el-table-column>
        <el-table-column prop="hname" label="姓名" width="180">
        </el-table-column>
        <el-table-column prop="hnickname" label="昵称" width="180">
        </el-table-column>
        <el-table-column prop="hsex" label="性别">
        </el-table-column>
        <el-table-column sortable prop="hage" label="年龄">
        </el-table-column>
        <el-table-column prop="company" label="公司">
        </el-table-column>
        <el-table-column prop="email" label="邮箱地址">
        </el-table-column>
        <el-table-column fixed="right" label="操作" width="120">
            <template slot-scope="scope">
                <el-button @click.native.prevent="deleteRow(scope.$index, tableData)" type="text" size="small">
                    删除
                </el-button>
            </template>
        </el-table-column>
    </el-table>
</div>
</template>

<script>
export default {
    name: 'RecommendEnterpriserManager',

    data() {
        return {
            tableData: []
        };
    },

    mounted() {
        this.loadData();
    },

    methods: {
        loadData() {
            this.$axios.post('/enterprise/queryEnterprises').then((res) => {
                if (res.data.result != null) {
                    this.tableData = res.data.result;
                }
            }).catch((error) => {
                console.log(error)
            })
        },

        deleteRow(index, rows) {
            rows.splice(index, 1);
        }
    },
};
</script>

<style lang="scss" scoped>

</style>
